Transaction recovery

ABSTRACT

Transaction recovery in a cloud computing environment. Transaction recovery includes determining whether a first container of a plurality of containers in the cloud computing environment is crashed. In response to the first container being crashed, the method may include determining at least one transaction log entry from a first log file corresponding to the first container. Transaction recovery includes retrieving at least one in-doubt transaction corresponding to the first container from a first database corresponding to the first container. Transaction recovery includes comparing the at least one transaction log entry with the at least one in-doubt transaction for transaction recovery.

BACKGROUND

The present invention relates to cloud computing technologies, and morespecifically, to a method, system and computer program product fortransaction recovery in a cloud computing environment.

Cloud computing environments, such as Kubernetes or other cloudcomputing environments, are widely used today. Containers are running ina cloud computing environment, and applications and application serversare running on these containers. An application server is a softwareframework that provides abundant facilities and a stable environment forapplications running on the application server. An application mayprocess business logic in which data may be inserted into or deletedfrom a database system.

SUMMARY

This summary is provided to introduce a selection of concepts in asimplified form that are further described below in the detaileddescription. This summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

According to a first aspect of the present invention, there is provideda computer-implemented method. The method includes determining whether afirst container of a plurality of containers in a cloud computingenvironment is crashed. In response to the first container beingcrashed, the method includes determining at least one transaction logentry from a first log file corresponding to the first container. Themethod further includes retrieving at least one in-doubt transactioncorresponding to the first container from a first database correspondingto the first container. The method further includes comparing the atleast one transaction log entry with the at least one in-doubttransaction for transaction recovery.

According to a second aspect of the present invention, there is provideda computer system. The computer system comprises a first component witha processing unit in a cloud computing environment and a memory coupledto the processing unit and storing instructions thereon. Theinstructions, when executed by the processing unit, perform actions ofthe computer implemented method described above.

According to a third aspect of the present invention, there is provideda computer program product comprising a computer-readable storage mediumhaving program instructions embodied therewith. The program instructionsare executable by a first component with a processor in a cloudcomputing environment to cause the processor to perform actions of thecomputer implemented method described above.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

Through the more detailed description of some embodiments of the presentinvention in the accompanying drawings, the above and other objects,features and advantages of the present invention will become moreapparent, wherein the same reference generally refers to the samecomponents in the embodiments of the present invention. The variousfeatures of the drawings are not to scale as the illustrations are forclarity in facilitating one skilled in the art in understandingembodiments of the present invention in conjunction with the detaileddescription. The drawings are discussed forthwith below.

FIG. 1 depicts a cloud computing node according to some embodiments ofthe present invention.

FIG. 2 depicts a cloud computing environment according to someembodiments of the present invention.

FIG. 3 depicts abstraction model layers according to some embodiments ofthe present invention.

FIG. 4 depicts a schematic diagram of an exemplary cloud computingenvironment for processing transactions in accordance with an embodimentof the present invention.

FIG. 5 depicts a schematic diagram of a proposed exemplary cloudcomputing environment for transaction recovery according to someembodiments of the present invention.

FIG. 6 depicts a schematic diagram of a proposed exemplary cloudtransaction recovery component for transaction recovery in a cloudcomputing environment according to some embodiments of the presentinvention.

FIG. 7 depicts a flowchart of an exemplary method for transactionrecovery in a cloud computing environment according to some embodimentsof the present invention.

DETAILED DESCRIPTION

Embodiments of the present invention will now be described in detailwith reference to the accompanying Figures.

The following description with reference to the accompanying drawings isprovided to assist in a comprehensive understanding of exemplaryembodiments of the invention as defined by the claims and theirequivalents. It includes various specific details to assist in thatunderstanding but these are to be regarded as merely exemplary.Accordingly, those of ordinary skill in the art will recognize thatvarious changes and modifications of the embodiments described hereincan be made without departing from the scope and spirit of theinvention. In addition, descriptions of well-known functions andconstructions may be omitted for clarity and conciseness.

In the following, reference is made to various embodiments of theinvention. However, it should be understood that the invention is notlimited to specific described embodiments. Instead, any combination ofthe following features and elements, whether related to differentembodiments or not, is contemplated to implement and practice theinvention. Furthermore, although embodiments may achieve advantages overother possible solutions and/or over the prior art, whether or not aparticular advantage is achieved by a given embodiment is not limiting.Thus, the following aspects, features, embodiments, and advantages aremerely illustrative and are not considered elements or limitations ofthe appended claims except where explicitly recited in a claim(s).Likewise, reference to “the invention” shall not be construed as ageneralization of any inventive subject matter disclosed herein andshall not be considered to be an element or limitation of the appendedclaims except where explicitly recited in a claim(s).

The terms and words used in the following description and claims are notlimited to the bibliographical meanings, but, are merely used to enablea clear and consistent understanding of the invention. Accordingly, itshould be apparent to those skilled in the art that the followingdescription of exemplary embodiments of the present invention isprovided for illustration purpose only and not for the purpose oflimiting the invention as defined by the appended claims and theirequivalents.

It is to be understood that the singular forms “a,” “an,” and “the”include plural referents unless the context clearly dictates otherwise.Thus, for example, reference to “a component surface” includes referenceto one or more of such surfaces unless the context clearly dictatesotherwise.

It is to be understood that although this invention includes a detaileddescription on cloud computing, implementation of the teachings recitedherein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure that includes anetwork of interconnected nodes.

Referring now to FIG. 1, a schematic of an example of a cloud computingnode is shown. Cloud computing node 10 is only one example of a suitablecloud computing node and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the inventiondescribed herein. Regardless, cloud computing node 10 is capable ofbeing implemented and/or performing any of the functionality set forthhereinabove.

In cloud computing node 10 there is a computer system/server 12 or aportable electronic device such as a communication device, which isoperational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, hand-held or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 1, computer system/server 12 in cloud computing node 10is shown in the form of a general-purpose computing device. Thecomponents of computer system/server 12 may include, but are not limitedto, one or more processors or processing units 16, a system memory 28,and a bus 18 that couples various system components including systemmemory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnect (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples, include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

Referring now to FIG. 2, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 includes one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 2 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 3, a set of functional abstraction layers providedby cloud computing environment 50 (as shown in FIG. 2) is shown. Itshould be understood in advance that the components, layers, andfunctions shown in FIG. 3 are intended to be illustrative only andembodiments of the invention are not limited thereto. As depicted, thefollowing layers and corresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may include applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provide pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and transaction recovery 96.

An application can use a two-phase commit (2PC) protocol to handle atransaction, so that necessary data regarding to the transaction can bestored into a database system safely. A container on which theapplication is running may be crashed due to many reasons, such as,wrong logic in the application program, out of memory, virtual machineon which the container is running being crashed, and so on. Under suchscenarios, the application is broken too. If the application isprocessing a transaction, it may result in a broken transaction from theapplications server point of view or even an in-doubt transaction fromthe database system point of view. The in-doubt transaction has to beresolved, otherwise the result may be inconsistent. Furthermore, if thedatabase lock is involved in by the in-doubt transaction, the databaselock won't be released until the in-doubt transaction is resolved.

FIG. 4 depicts a schematic diagram of an existing exemplary cloudcomputing environment 400 for processing transactions. Here a containermeans a container instance in a cloud computing environment, and acontainer instance is an instance of an image. Referring to FIG. 4, aplurality of containers, e.g. a container 401-1, a container 401-2, . .. , a container 401-N (collectively referred to as containers 401 orindividually referred to as container 401) are running in the cloudcomputing environment 400. A plurality of application servers, e.g. anapplication server 402-1, an application server 402-2, . . . , anapplication server 402-N (collectively or referred to as applicationservers 402 or individually referred to as application server 402) and aplurality of applications, e.g. an application 403-1, an application403-2, . . . , an application 403-N (collectively referred to asapplications 403 or individually referred to as application 403) arerunning on the containers 401 respectively. These application servers402 may provide transaction frameworks, such as provide ApplicationProgramming Interfaces (APIs) for handling transactions to databases.Each application 403 may invoke these APIs and then each applicationsserver 402 may handle transactions to a database, for example, theapplication server 402-1 may handle transactions to a database 405-1 andthe applications server 402-2 to 402-N may handle transactions to adatabase 405-2. If an application server 402, such as application server402-2, is crashed, a transaction to the database 405-2 corresponding tothe application server 402-2 may be broken, which may lead to anin-doubt transaction in the database 405-2. In order to avoid brokentransactions even in-doubt transactions, each application server 402 hasits own transaction log file respectively, e.g. an transaction (TX) logfile 404-1 corresponding to the application server 402-1, an transaction(TX) log file 404-2 corresponding to the application server 402-2, . . ., an transaction (TX) log file 404-N (collectively referred to as TX logfiles 404 or individually referred to as TX log file 404) correspondingto the application server 402-N, configured on respective persistentcomponents outside of the cloud computing environment 400, to recordtransaction log entries corresponding to each application server itself.Therefore, the application server 402-1 can access entries in the TX logfile 404-1, the application server 402-2 can access entries in the TXlog file 404-2, and so on, but the application server 402-1 cannotaccess entries in the TX log files 404-2 to 404-N.

In the following description, the container 401-2 is taken as an exampleto show a working process related to transaction log for each container.During the execution, if the application server 402-2 conductstransactions on the database 405-2, the application server 402-2 canstore the transaction log entries to the transaction log file 404-2. Ifthe container 401-2 is crashed, the broken transactions may occur, thecloud computing environment 400 has to wait the container 401-2 to berestarted and then the application server 402-2 can retrieve thetransaction log entries from the transaction log file 404-2, and thenthe application server 402-2 can cooperate with the database system405-2 by comparing in-doubt transactions corresponding to the container401-2 in the database 405-2 with the transaction log entries todetermine how to handle the in-doubt transactions. This is currentworking model for transaction recovery for application server 402-2 thatrunning on the container 401-2 in cloud computing environment 400.

However, there are several drawbacks for the above existingimplementation.

First, the restarting process for the container 401-2 may take sometime, especially when the application 403-2 provides complex functions.This becomes worse if the restarting process for the container 401-2needs to pull a new image, which may take a lot of time before thecontainer 401-2 could be ready. State differently, the in-doubttransactions have to be suspended on the database 405-2 for severalminutes, and database locks, if any, may exist on the database 405-2 forseveral minutes, all locked units could not be operated. Such scenariomay block other containers to use the locked units and may cause othercontainers perform worse.

Second, the transaction log files for respective application serversshould be configured on a storage, and files on a file system storingtransaction log entries for different application servers should bedifferent. In other words, different application servers should usedifferent files in a storage to store their owned transaction logentries. However, there is no cloud computing environment providing suchfeatures, so it usually requires container developers to implement suchlogic, or a cloud system administrator has to be involved in to providethe additional maintenance work for this function.

Third, the cloud computing environment today can adjust the number ofcontainers according to workload and resource usage in each container,so the number of containers in the cloud computing environment isdynamic, which make it more difficult for the container developers andthe cloud system administrator to support such function.

Therefore, it is necessary to resolve the above problem in a cloudcomputing environment to provide automatic transaction recoverymechanism from the architectural level. It will be described in moredetail below in combination with FIG. 5.

FIG. 5 depicts a schematic diagram of a proposed exemplary cloudcomputing environment 500 for transaction recovery according to someembodiments of the present invention. Now referring to FIG. 5, in theproposed exemplary cloud computing environment 500, a plurality ofcontainers, e.g. a container 501-1, a container 501-2, . . . , acontainer 501-N (collectively referred to as containers 501 orindividually referred to as container 501) are running in the cloudcomputing environment 500. A plurality of application servers, e.g. anapplication server 502-1, an application server 502-2, . . . , anapplication server 502-N (collectively referred to as applicationservers 502 or individually referred to as application server 502) and aplurality of applications, e.g. an application 503-1, an application503-2, . . . , an application 503-N (collectively referred to asapplications 503 or individually referred to as application 503) arerunning on the containers 501 respectively. These application servers503 may provide transaction frameworks, such as provide ApplicationProgramming Interfaces (APIs) for handling transactions to databases.Each application 503 may invoke these APIs and then each applicationsserver 502 may handle transactions to a database, for example, theapplication server 502-1 handles transactions to a database 505-1 andthe applications server 502-2 to 502-N handle transactions to a database505-2 (The database 505-1 and database 505-2 are collectively referredto databases 505 or individually referred to as database 505). If anapplication server 502, such as application server 502-2, is crashed,transactions to the database 505-2 corresponding to the applicationserver 502-2 may be broken, which may lead to in-doubt transactions inthe database 505-2. In order to avoid the broken transactions or thein-doubt transactions, each application server 502 has its owntransaction log file respectively, e.g. an transaction (TX) log file504-1, an transaction (TX) log file 504-2, . . . , an transaction (TX)log file 504-N (collectively referred to as TX log files 504 orindividually referred to as TX log file 504). As shown in FIG. 5, thetransaction log files 504 are stored together in a storage 508 outsideof each container 501 and also outside of the cloud computingenvironment 500. It can be appreciated that the storage 508 can beoutside of each container 501 and but in the cloud computing environment500. It can be also appreciated that the transaction log files 504 canbe stored in different storages. The embodiment of using storage 508 iseasy to be implemented and will be used as an example to describe theinvention. Similar to the practice in FIG. 4, the application server502-1 can access entries in the TX log file 504-1, the applicationserver 502-2 can access entries in the TX log file 504-2, and so on, butthe application server 502-1 cannot access entries in the TX log files504-2 to 504-N.

Specifically, there is a component named transaction plug-in in eachapplication server respectively, state from a different point of view, atransaction plug-in 506-1 is composed in the application server 502-1, atransaction plug-in 506-2 is composed in the application server 502-2, .. . , a transaction plug-in 506-N is composed in the application server502-N. Moreover, a transaction recovery component 507 is composed in thecloud computing environment 500 but outside of each container 501. Allcomponents, either inside of the cloud computing environment 500 oroutside of the cloud computing environment 500 are connected directly orindirectly via communication network (not shown in FIG. 5).

The communication network in FIG. 5 may include various types ofcommunication networks, such as a wide area network (WAN), local areanetwork (LAN), a telecommunication network, a wireless network, a publicswitched network and/or a satellite network. The communication networkmay include connections, such as wire, wireless communication links, orfiber optic cables.

Each component in the cloud computing environment 500 may be, forexample, a mobile device, a telephone, a personal digital assistant, anetbook, a laptop computer, a tablet computer, a desktop computer, orany type of computing device capable of running a program and accessinga network. The cloud computing environment 500 may operate in a cloudcomputing service model, such as Software as a Service (SaaS), Platformas a Service (PaaS), or Infrastructure as a Service (IaaS). The cloudcomputing environment 500 may also be located in a cloud computingdeployment model, such as a private cloud, community cloud, publiccloud, or hybrid cloud.

The components with the same name in both FIG. 4 and FIG. 5, such ascontainer, application, application server, database, transaction logfile, have same functions, so their function will not be repetitivelydescribed for sake of brevity.

In the following description, the container 501-2 is taken as an exampleto show a working process related to transaction log for each container501. When the container 501-2 is deployed or created in the cloudcomputing environment 500 and the application server 502-2 is deployedon the container 501-2, a transaction plugin 506-2 may be integrated inthe application server 502-2, as well as in the container 501-2. Thetransaction plug-in 506-2 may add hook to the application server 502-2on the transaction log operations by utilizing existing interface orother known technologies to intercept transaction log requests in theapplication server 502-2. During processing a transaction, theapplication server 502-2 may trigger transaction log operations, such assend requests for writing a transaction log entry. Then the transactionplugin 506-2 may intercept those requests and redirect these requests tothe cloud transaction recovery component 507. And transaction logentries may be composed in these requests. Other transaction plug-ins,such as the transaction plug-in 506-1, . . . , the transaction plug-in506-N have the same functions with the transaction plugin 506-2. In thisway, the cloud transaction recovery component 507 can take over anytransaction log operations that triggered by any application servers 502in any containers 501 of the cloud computing environment 500automatically, and there is no need for developer to modify codes of theapplication servers 502 or applications 503 to introduce suchfunctionality.

A transaction log request is triggered by an application server 502 on acontainer 501, is intercepted by a transaction plug-in 506 in theapplication server 502 and sent to the cloud transaction recoverycomponent 507. From the cloud transaction recovery component 507 pointof view, the transaction log request is from the container 501, nomatter which application server 502 the transaction log request comesfrom.

FIG. 6 depicts a schematic diagram of a proposed exemplary cloudtransaction recovery component 507 for transaction recovery in a cloudcomputing environment 500 according to some embodiments of the presentinvention. FIG. 6 can be regarded as an implementation of the cloudtransaction recovery component 507 in FIG. 5. It can be understood thatthe cloud transaction recovery component 507 can leverage otherimplementations.

Now referring to FIG. 6, the cloud transaction recovery component 507comprises a transaction log writer 601, a container status tracker 602,a transaction log reader 603 and a transaction recovery component 604.In addition, the cloud transaction recovery component 507 may maintain afirst mapping between each transaction log file 504 and each container501 and a second mapping between each database resource 505 and eachcontainer 501. Functions of each components in FIG. 6 will be describedin more detail below in combination with FIG. 5.

In some embodiments, the cloud system administrator may create eachtransaction log file 504 for each container 501 in the storage 508, asshown in transaction log files 504-1 to 504-N in FIG. 5. In addition,the cloud system administrator may create the first mapping between eachtransaction log file 504 and each container 501. Table 1 is an exemplaryfirst mapping between each transaction log file 504 and each container501. As shown, Table 1 may record the first mapping by recording eachcontainer ID/name in the cloud computing environment 500 and the pathand file name of corresponding created transaction log file 504.

TABLE 1 Container ID Path and file name of transaction log file ID ofContainer 501-1 Path and file name of transaction log file 504-1 ID ofContainer 501-2 Path and file name of transaction log file 504-1 . . . .. . ID of Container 501-N Path and file name of transaction log file504-N

Further, the cloud system administrator may create the second mappingbetween each database 505 and each container 501. Table 2 is anexemplary second mapping between each database resource 505 and eachcontainer. As shown, Table 2 may record the second mapping by recordingeach container ID/name in the cloud computing environment 500 and theresource of database 505 accessed by the corresponding container 501.The database resource in Table 2 can include database name, username,password, and the like. Alternatively, the database resource can be acreated database connection, which can be directly used by thetransaction recovery component 507 to save time to build a connection tothe corresponding database 505.

TABLE 2 Container ID DB resource ID of Container 501-1 DB1 resource IDof Container 501-2 DB2 resource . . . . . . ID of Container 501-N DB2source

Those skilled in the art may understand that the schemas of both thefirst mapping and the second mapping are just for illustrative purpose,other columns can be added to the Table 1 or Table 2. Further, it shouldbe understood that the aforementioned tables are only implementations torepresent the first or second mappings, other data structures can beused to represent the first and the second mappings, such as XML file,text file, and the like. This implementation (cloud system administratorcreates mappings) is suitable for the scenario that the number ofcontainers 501 in the cloud computing environment 500 is static. Becauseif the number of containers 501 in the cloud computing environment 500is dynamic, the cloud system administrator cannot create transaction logfile, as well as the first and second mappings, accordingly.

In some embodiments, when a first transaction log request redirectedfrom the transaction plug-in 506-2 running on the container 501-2 isreceived by the cloud transaction recovery component 507, thetransaction log writer 601 may create a transaction log file 504-2 forthe container 501-2 in the storage 508, as shown in FIG. 5. Thetransaction log file 504-2 would be used to persist the transaction logentries. In addition, the transaction log writer 601 may create an entryto record the first mapping between the container 501-2 and the createdtransaction log file 504-2, as shown in Table 1. Also, the transactionlog writer 601 may create another entry to record the second mappingbetween the container 501-2 and a corresponding database 505 resource byparsing the first transaction log request to determine the correspondingdatabase 505 resource, as shown in Table 2. This implementation issuitable for the scenario that the number of containers 501 in the cloudcomputing environment 500 is dynamic since both the transaction log file504 and the first and the second mappings are created on demand Thus,even the cloud computing environment 500 scales up and a new container501 is deployed, this implementation can still support the transactionrecovery functionality.

In some embodiments, After the transaction log files 504, the first andthe second mappings are created, when the transaction plug-in 506-2redirects a request from the container 501-2 for writing a transactionlog entry into corresponding transaction log file 504, the transactionlog writer 601 may receive the request and then check the first mappingto get the corresponding transaction log file 504-2, then write thetransaction log entry into the transaction log file 504-2.

In some embodiments, if the application server 502-2 requests to readtransaction log entries, the transaction plug-in 506-2 may redirect therequest to the cloud transaction recovery component 507. The transactionlog reader 603 in the cloud transaction recovery component 507 mayreceive the request and check the first mapping to get the correspondingtransaction log file 504-2. The transaction log reader 603 may then readthe transaction log entries from the transaction log file 504-2 and sendthe transaction log entries to corresponding container 501.

In some embodiments, as the cloud transaction recovery component 507 isa cloud native component of the cloud computing environment 500, thecloud transaction recovery component 507 can detect other containerstatus easily via the container status tracker 602 using existingtechnologies, such as heartbeat and the like, so if any container 501 inthe cloud computing environment 500 is crashed, the container statustracker 602 may know that immediately.

In some embodiments, if the container 501-2 in the cloud computingenvironment 500 is crashed according to the container status tracker602, the cloud transaction recovery component 507 may handle thetransaction recovery progress immediately. Specifically, the transactionrecovery component 604 in the cloud transaction recovery component 507may first call the transaction log reader 603, which may check the firstmapping and get the corresponding transaction log file 504-2 for thecrashed container 501-2 and then get at least one transaction log entryin the transaction log file 504-2 to the transaction recovery component604. Then the transaction recovery component 604 may check the secondmapping to get the database 505-2 resource corresponding the crashedcontainer 501-2, and then retrieve a list of in-doubt transactions fromthe corresponding database. The transaction recovery component 604 maythen get at least one in-doubt transaction from the crashed container501-2. The transaction recovery component 604 may compare the at leastone transaction log entry for the crashed container 501-2 fromtransaction log file 504-2 with the at least one in-doubt transactionfor the crashed container 501-2 from the database 505-2, and thendetermine how recover the transactions, such as commit or rollback,using existing technologies. In this way, the at least one in-doubttransaction may be resolved in very short time before the crashedcontainer is restarted. The transaction recovery component 604 may thendelete the at least one transaction log entry from transaction log file504-2 corresponding to the container 501-2 after the at least onein-doubt transaction is recovered.

In some embodiments, during the transaction recovery component 604retrieves the list of in-doubt transactions from database 505-2 to getthe at least one in-doubt transaction for the crashed container 501-2,the transaction recovery component 604 may first create the databaseconnection based on the database 505-2 resource in the second mappingand then retrieves the list of in-doubt transactions from database 505-2so as to get the at least one in-doubt transaction for the crashedcontainer 501-2.

If the container 501-2 in the cloud computing environment 500 iscrashed, the container 501-2 would restart automatically. As it mayspend some time for the container 501-2 to restart, the in-doubletransaction may be resolved using the above cloud computing environment500 and the cloud transaction recovery component 604 during this time.After the container 501-2 that running application server 502-2 isrestarted, the application server 502-2 may continue to work as general.

FIG. 7 depicts a flowchart of an exemplary method 700 for transactionrecovery in a cloud computing environment according to some embodimentsof the present invention.

The method 700 may be implemented by the cloud transaction recoverycomponent 507, or other suitable computer/computing systems, which isreferred to as a first component in the cloud computing environment 500.For ease of understanding, the method 700 will be described withreference to FIG. 5.

At 710, the cloud transaction recovery component 507 (a first component)may determine whether a first container of a plurality of containers inthe cloud computing environment 500 is crashed.

In some embodiments, there is a second component, e.g. transactionplug-in 506, in each container 501 in the cloud computing environment500, each second component 506 add hook on transaction log requests fromeach container 501 and redirect the transaction log requests to thecloud transaction recovery component 507. The cloud transaction recoverycomponent 507, as a native component in the cloud computing environment500, can track status of each container 501.

In some embodiments, the method further comprises a step (not shown inFIG. 7) of recording respective transaction log entries redirected byrespective second components 506 in respective containers 501 intorespective transaction log files 504 corresponding to respectivecontainers 501, all the respective log files 504 are stored in astorage.

In some embodiment, each transaction log file 504 corresponding to eachcontainer 501 is created by the administrator of the cloud computingenvironment 500, and a first mapping between respective containers 501and respective transaction log files 504 and a second mapping betweenrespective containers 501 and respective database 505 resources are alsocreated by the cloud system administrator of the cloud computingenvironment 500.

In some embodiment, each transaction log file 504 corresponding to eachcontainer 501 is created by the cloud transaction recovery component 507in the cloud computing environment 500, and the first mapping betweenrespective containers 501 and respective transaction log files 504 andthe second mapping between respective containers 501 and respectivedatabase 505 resources are also created by the cloud transactionrecovery component 507 in the cloud computing environment 500 when thecloud transaction recovery component 507 receives a first transactionlog operation related to each container 501. This implementation mayadapt to a scenario that the number of containers 501 in the cloudcomputing environment 500 are dynamic.

In some embodiments, if the cloud transaction recovery component 507receive a request for recording a transaction log entry from a container501, the cloud transaction recovery component 507 may determine atransaction log file 504 corresponding to the container 501 based on thefirst mapping and then record the transaction log entry to thecorresponding transaction log file 504. In this way, operations fortransaction log writing can be processed by the cloud transactionrecovery component 507 after being redirected by the second component inthe second container.

Referring back to FIG. 7, at 720, in response to a first container beingcrashed, the cloud transaction recovery component 507 may determine atleast one transaction log entry from a first log file corresponding tothe first container. In order to implement step 720, the cloudtransaction recovery component 507 may determine the first log filecorresponding to the first container based on the first mapping and thenread the at least one transaction log entry from the first transactionlog file. All transaction log entries are related to activetransactions, which is known by those skilled in the art.

At 730, the cloud transaction recovery component 507 may retrieve atleast one in-doubt transaction from a first database corresponding tothe first container. In order to implement the step 730, the cloudtransaction recovery component 507 may determine the first databasecorresponding to the first container based on a second mapping, thenretrieve a list of in-doubt transactions from the first database, andfinally determine the at least one in-doubt transaction corresponding tothe first container. How to determine the at least one in-doubttransaction corresponding to the first container from the list ofin-doubt transactions from the first database is well known by thoseskilled in the art, so the detailed description is omitted herein.

At 740, the cloud transaction recovery component 507 may compare the atleast one transaction log entries with the at least one in-doubttransaction for transaction recovery using existing technologies. Aftercomparing the at least one transaction log entry with the at least onein-doubt transaction, a final decision, such as “commit” or “rollback”,can be made by the cloud transaction recovery component 507 to thedatabase so as to recover the at least one in-doubt transaction. This iswell known by those skilled in the art and detailed implementation isomitted herein.

In some embodiments, after the at least one in-doubt transaction isrecovered, the cloud transaction recovery component 507 may delete theat least one transaction log entry from a first log file correspondingto the first container. In this way, after the first containerre-starts, the application server and the application in the containermay work normally.

The proposed method can make it easier from architectural level torecover in-doubt transactions conducting by a crashed container in acloud computing environment. In addition, it is easier for developers todevelop framework for transaction recovery in a cloud computingenvironment using the proposed method.

It should be noted that the processing of transaction recovery in acloud computing environment according to embodiments of the presentinvention could be implemented by computer system/server 12 of FIG. 1.

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform certain embodiments of the presentinvention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a computer, or other programmable data processing apparatusto produce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks. These computerreadable program instructions may also be stored in a computer readablestorage medium that can direct a computer, a programmable dataprocessing apparatus, and/or other devices to function in a particularmanner, such that the computer readable storage medium havinginstructions stored therein comprises an article of manufactureincluding instructions which implement aspects of the function/actspecified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be accomplished as one step, executed concurrently,substantially concurrently, in a partially or wholly temporallyoverlapping manner, or the blocks may sometimes be executed in thereverse order, depending upon the functionality involved. It will alsobe noted that each block of the block diagrams and/or flowchartillustration, and combinations of blocks in the block diagrams and/orflowchart illustration, can be implemented by special purposehardware-based systems that perform the specified functions or acts orcarry out combinations of special purpose hardware and computerinstructions.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

What is claimed is:
 1. A computer-implemented method, comprising:determining, by a first component with one or more processors in a cloudcomputing environment, whether a first container of a plurality ofcontainers in the cloud computing environment is crashed; in response tothe first container being crashed: determining, by the first component,at least one transaction log entry from a first log file correspondingto the first container; retrieving, by the first component, at least onein-doubt transaction corresponding to the first container from a firstdatabase corresponding to the first container; and comparing, by thefirst component, the at least one transaction log entry with the atleast one in-doubt transaction for transaction recovery.
 2. The methodof claim 1, wherein respective second components in respectivecontainers of the plurality of containers add hook on transaction logrequests from the respective containers and redirect the transaction logrequests to the first component.
 3. The method of claim 2, furthercomprising: recording, by the first component, respective transactionlog entries redirected by respective second components in respectivecontainers into respective transaction log files corresponding torespective containers, the respective log files being stored in astorage.
 4. The method of claim 3, wherein the recording respectivetransaction log entries redirected by respective second components inrespective containers into respective transaction log filescorresponding to respective containers comprises: creating, by the firstcomponent, the respective transaction log files corresponding torespective containers in the storage; creating, by the first component,a first mapping between respective containers and respective transactionlog files; and creating, by the first component, a second mappingbetween respective containers and respective database resources.
 5. Themethod of claim 4, wherein the recording respective transaction logentries redirected by respective second components in respectivecontainers into respective transaction log files corresponding torespective containers further comprises: in response to receiving arequest for recording a transaction log entry from a second component ofa second container: determining, by the first component, a secondtransaction log file corresponding to the second container based on thefirst mapping; and recording, by the first component, the transactionlog entry into the second transaction log file.
 6. The method of claim4, wherein the determining at least one transaction log entry from afirst transaction log file corresponding to the first containercomprise: determining, by the first component, the first transaction logfile corresponding to the first container based on the first mapping;and reading, by the first component, the at least one transaction logentry from the first transaction log file.
 7. The method of claim 4,wherein the retrieving at least one in-doubt transaction correspondingto the first container from a first database corresponding to the firstcontainer comprises: determining, by the first component, the firstdatabase resource corresponding to the first container based on thesecond mapping; retrieving, by the first component, a list of allin-doubt transactions from the first database; and determining, by thefirst component, the at least one in-doubt transaction corresponding tothe first container.
 8. The method of claim 1, further comprising:deleting, by the first component, the at least one transaction log entryfrom the first log file corresponding to the first container in responseto the at least one in-doubt transactions being recovered.
 9. A system,comprising: a first component with a processing unit in a cloudcomputing environment; and a memory coupled to the processing unit andstoring instructions thereon, the instructions, when executed by theprocessing unit, performing actions including: determining whether afirst container of a plurality of containers in the cloud computingenvironment is crashed; in response to the first container beingcrashed: determining at least one transaction log entry from a first logfile corresponding to the first container; retrieving at least onein-doubt transaction corresponding to the first container from a firstdatabase corresponding to the first container; and comparing the atleast one transaction log entry with the at least one in-doubttransaction for transaction recovery.
 10. The system of claim 9, whereinrespective second components in respective containers of the pluralityof containers add hook on transaction log requests from the respectivecontainers and redirect the transaction log requests to the firstcomponent.
 11. The system of claim 10, wherein the actions furtherinclude: recording respective transaction log entries redirected byrespective second components in respective containers into respectivetransaction log files corresponding to respective containers, therespective log files being stored in a storage.
 12. The system of claim11, wherein the recording respective transaction log entries redirectedby respective second components in respective containers into respectivetransaction log files corresponding to respective containers comprises:creating the respective transaction log files corresponding torespective containers in the storage; creating a first mapping betweenrespective containers and respective transaction log files; and creatinga second mapping between respective containers and respective databaseresources. in response to receiving a request for recording atransaction log entry from a second component of a second container:determining a second transaction log file corresponding to the secondcontainer based on the first mapping; and recording the transaction logentry into the second transaction log file.
 13. The system of claim 12,wherein the retrieving at least one in-doubt transaction correspondingto the first container from a first database corresponding to the firstcontainer comprises: determining the first database resourcecorresponding to the first container based on the second mapping;retrieving a list of all in-doubt transactions from the first database;and determining the at least one in-doubt transaction corresponding tothe first container.
 14. The system of claim 9, the actions furtherincluding: deleting the at least one transaction log entry from thefirst log file corresponding to the first container in response to theat least one in-doubt transactions being recovered.
 15. A computerprogram product, comprising a computer-readable storage medium havingprogram instructions embodied therewith, the program instructionsexecutable by a first component with a processor in a cloud computingenvironment to cause the processor to perform actions including:determining whether a first container of a plurality of containers inthe cloud computing environment is crashed; in response to the firstcontainer being crashed: determining at least one transaction log entryfrom a first log file corresponding to the first container; retrievingat least one in-doubt transaction corresponding to the first containerfrom a first database corresponding to the first container; andcomparing the at least one transaction log entry with the at least onein-doubt transaction for transaction recovery.
 16. The computer programproduct of claim 15, wherein respective second components in respectivecontainers of the plurality of containers add hook on transaction logrequests from the respective containers and redirect the transaction logrequests to the first component.
 17. The computer program product ofclaim 16, wherein the actions further include: recording respectivetransaction log entries redirected by respective second components inrespective containers into respective transaction log filescorresponding to respective containers, the respective log files beingstored in a storage.
 18. The computer program product of claim 17,wherein the recording respective transaction log entries redirected byrespective second components in respective containers into respectivetransaction log files corresponding to respective containers comprises:creating the respective transaction log files corresponding torespective containers in the storage; creating a first mapping betweenrespective containers and respective transaction log files; and creatinga second mapping between respective containers and respective databaseresources. in response to receiving a request for recording atransaction log entry from a second component of a second container:determining a second transaction log file corresponding to the secondcontainer based on the first mapping; and recording the transaction logentry into the second transaction log file.
 19. The computer programproduct of claim 18, wherein the retrieving at least one in-doubttransactions corresponding to the first container from a first databasecorresponding to the first container comprises: determining the firstdatabase resource corresponding to the first container based on thesecond mapping; retrieving a list of all in-doubt transactions from thefirst database; and determining the at least one in-doubt transactionscorresponding to the first container.
 20. The computer program productof claim 15, the actions further including: deleting the at least onetransaction log entry from the first log file corresponding to the firstcontainer in response to the at least one in-doubt transaction beingrecovered.